package cn.jinjimi.app.main.extend;

import android.content.Intent;
import android.os.Bundle;

import cn.jinjimi.base.util.LogUtil;
import cn.jinjimi.app.R;

/**
 * Created by Roy
 * Date: 16/5/16
 */
public class BaseFrameActivity extends SwipeActivity {
    public static final String TAG = BaseActivity.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LogUtil.d(TAG, this.getClass().getSimpleName() + " onCreate()");
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        LogUtil.d(TAG, this.getClass().getSimpleName() + " onPostCreate()");
    }

    @Override
    protected void onResume() {
        super.onResume();
        LogUtil.d(TAG, this.getClass().getSimpleName() + " onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        LogUtil.d(TAG, this.getClass().getSimpleName() + " onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        LogUtil.d(TAG, this.getClass().getSimpleName() + " onStop");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        LogUtil.d(TAG, this.getClass().getSimpleName() + " onRestart");
        overridePendingTransition(R.anim.activity_right_in, R.anim.activity_right_out);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        LogUtil.d(TAG, this.getClass().getSimpleName() + " onDestory");
    }

    @Override
    public void startActivity(Intent intent) {
        super.startActivity(intent);
        onGoTransition();
    }

    @Override
    public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
        super.startActivityForResult(intent, requestCode, options);
        onGoTransition();
    }

    protected void onGoTransition() {
        overridePendingTransition(R.anim.activity_left_in, R.anim.activity_left_out);
    }

    protected void onBackTransition() {
        overridePendingTransition(R.anim.activity_right_in, R.anim.activity_right_out);
    }
}
